package cn.donting.jme.expansion.tool.transform;

import com.jme3.scene.Mesh;
import com.jme3.scene.VertexBuffer;

public class XAxisMesh extends Mesh {

    private float width;
    private float height;

    public XAxisMesh() {
        updateGeometry(10000f,10000f);
    }


    public void updateGeometry(float w, float h) {
        this.width = w;
        this.height = h;

        float[] pos = new float[]{
                -w / 2, h / 2, 0,
                -w / 2, -h / 2, 0,
                w / 2, -h / 2, 0,
                w / 2, h / 2, 0
        };

        int[] index = new int[]{
                0, 1, 2,
                2, 3, 0
        };
        setBuffer(VertexBuffer.Type.Position,3,pos);
        setBuffer(VertexBuffer.Type.Index,3,index);
        updateBound();
    }
}
